/*
 * @Author: your name
 * @Date: 2024-03-21 22:22:58
 * @LastEditTime: 2024-03-21 22:26:56
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \.leetcode\283.移动零.cpp
 */
/*
 * @lc app=leetcode.cn id=283 lang=cpp
 *
 * [283] 移动零
 */

// @lc code=start
class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int slow = 0;
        for(int fast = 0; fast < nums.size(); fast++){
            if(nums[fast] != 0){
                nums[slow++] = nums[fast];
            }
        }
        for (int i = slow; i < nums.size(); i++)
        {
            /* code */
            nums[i] = 0;
        }
        
    }
};
// @lc code=end

